using System.ComponentModel;

namespace SumerCoreDevOps.Application.Dtos.Requests.NodeRegistration
{
    /// <summary>
    /// 生成令牌请求
    /// </summary>
    public class GenerateTokenRequest
    {
        /// <summary>
        /// 令牌名称
        /// </summary>
        /// <example>Production Node Token</example>
        [Description("令牌名称")]
        public string? Name { get; set; }

        /// <summary>
        /// 令牌描述
        /// </summary>
        /// <example>用于生产环境节点注册</example>
        [Description("令牌描述")]
        public string? Description { get; set; }

        /// <summary>
        /// 过期时间（小时）
        /// </summary>
        /// <example>24</example>
        [Description("过期时间（小时）")]
        public int? ExpiresInHours { get; set; } = 24;

        /// <summary>
        /// 最大使用次数
        /// </summary>
        /// <example>1</example>
        [Description("最大使用次数")]
        public int? MaxUsageCount { get; set; } = 1;

        /// <summary>
        /// 创建者
        /// </summary>
        /// <example>admin</example>
        [Description("创建者")]
        public string? CreatedBy { get; set; }
    }

    /// <summary>
    /// 验证令牌请求
    /// </summary>
    public class ValidateTokenRequest
    {
        /// <summary>
        /// 令牌字符串
        /// </summary>
        /// <example>abc123def456</example>
        [Description("令牌字符串")]
        public string Token { get; set; } = null!;
    }

    /// <summary>
    /// 撤销令牌请求
    /// </summary>
    public class RevokeTokenRequest
    {
        /// <summary>
        /// 撤销原因
        /// </summary>
        /// <example>安全原因</example>
        [Description("撤销原因")]
        public string Reason { get; set; } = null!;

        /// <summary>
        /// 撤销者
        /// </summary>
        /// <example>admin</example>
        [Description("撤销者")]
        public string? RevokedBy { get; set; }
    }
}
